<template>
  <div class="page result">
    <div class="scroll-view">
      <customHeader middleTitle="核销结果" />
      <div class="page-body">
        <div class="success" v-if="params.type=='success'">
          <result type="success" title="核销成功" />
          <ul class="form-style">
            <li>
              <span>商品名称</span>
              <div>{{params["goodsSalesName"]}}</div>
            </li>
            <li v-if="params['ticketType']==1">
              <span>券面额</span>
              <div>{{params["facePrice"]}}</div>
            </li>
            <li>
              <span>核销份数</span>
              <div>{{params["count"]}}</div>
            </li>
          </ul>
          <div class="btn-box">
            <div class="btn" @click="linkToDetails">查看详情</div>
            <div class="btn primary" @click="closePage">继续核销</div>
          </div>
        </div>
        <div class="fail" v-else>
          <result type="fail" title="核销失败" :msg="params.msg"></result>
          <div class="btn-wrap">
            <div class="btn" @click="closePage">重新核销</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Vue from 'vue';
import customHeader from '../../components/header/header';
import result from '../../components/result/result';
import jsBridge from "../../tools/jsBridge.js";
export default {
  name: 'cancelVerifiResult',
  data() {
    return {
      params: {},
    };
  },

  methods: {
    closePage() {
      jsBridge.closeWindow();
    },
    linkToDetails() {
      this.$router.push({ path: '/cancelVerifi/cancelVerifiList/details', query: { verifyId: this.params['id'] } });
    }
  },
  components: {
    customHeader,
    result
  },
  created() {
    this.params = this.$route.query;
  },
};
</script>
<style lang='scss' scoped>
@import "cancelVerifi";
</style>
